import { TrainQuestion, ResultData } from "@/api/interface/index";
import http from "@/api";
/**
 * @name 题库管理
 */
// 获取题库列表
export const getTrainQuestionList = (params: TrainQuestion.ReqTrainQuestionParams) => {
  return http.post<TrainQuestion.ResTrainQuestionList>(`/electcollect/trainQuestion/query`, params);
};

// 新增题库
export const addTrainQuestion = (params = {}) => {
  return http.post(`/electcollect/trainQuestion/add`, params);
};

// 编辑题库
export const editTrainQuestion = (params: { commandId: string }) => {
  return http.post(`/electcollect/trainQuestion/modify`, params);
};

// 删除题库
export const deleteTrainQuestion = (params: { questionList: { questionId: string }[] }) => {
  return http.post(`/electcollect/trainQuestion/remove`, params);
};

// 获取柜体详情
export const getTrainQuestionDtl = (params: { meterId: string }) => {
  return http.post<ResultData>(`/electcollect/files/device/detail`, params);
};

// 获取题库故障选择列表
export const getFaultSelList = (params = {}) => {
  return http.post(`/electcollect/trainQuestion/faultSelectionQuery`, params);
};
